package test_kevin;

import java.io.FileInputStream;
import java.io.IOException;

public class BreakStream extends Thread {
	FileInputStream fis;
	public int diff = 0;
	
	public BreakStream(FileInputStream fis){
		this.fis = fis;
		
		try {
			diff = fis.available();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void run(){
		goSleep(5000, this);
		try {
			System.out.println(diff-fis.available());
			fis.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}	
	
	@SuppressWarnings("static-access")
	public void goSleep(long time, Thread th) {
		try {
			th.sleep(time);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
